<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>背景</title>
		<style type="text/css">
			body{
				background-image:url("img/2.jpg");
				background-repeat:no-repeat;
				/* 背景图片固定fixed
					背景图片随着页面滚动：scroll
				 */
				background-attachment:fixed;
				background-position:right top;
				/* 复合写法 */
				background:gainsboro url(img/2.jpg) no-repeat fixed center/50% 50%;
			}
			.box{
				width:900px;
				height: 900px;
				/* background-color: rgb(170, 0, 0) */
				background-image:url("img/2.jpg");
				/* 背景图片重复显示:repeat（默认值）
				不重复:no-repeat
				横向重复显示:repeat-x
				纵向重复显示:repeat-y */
				background-repeat:no-repeat;
				font-size:36px;
			}
		</style>
	</head>
	<body>
		<div class="box">
			这是文本内容
		</div>
	</body>
</html>
